Skip to content

Conversation

@bfollington
Copy link
Contributor

@bfollington bfollington commented Oct 30, 2025

  • Auto-attach currently viewed charm
  • Make system prompt customizable for chatbot.tsx

Summary by cubic

Auto-attaches the most recently viewed charm to each chat and adds a listRecent tool so the assistant can pull in recent items without extra clicks, addressing Linear CT-1013. The chatbot system prompt is now configurable; Omnibox keeps the previous behavior by passing the existing prompt.

  • New Features
    • Auto-attaches the most recent charm; merges with user attachments, avoids duplicates, and prepends it.
    • Added listRecent tool to list recently viewed charm NAMEs as JSON.
    • Chatbot accepts a customizable system prompt; OmniboxFAB sets the previous prompt to preserve behavior.
    • Tools and UI now use attachmentsWithRecent for consistent navigation, listing, and sending.

@linear
Copy link

linear bot commented Oct 30, 2025

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="packages/patterns/chatbot.tsx">

<violation number="1" location="packages/patterns/chatbot.tsx:459">
Auto-attached charms rendered by the bar can no longer be removed: the bar now reads from attachmentsWithRecent, but removeAttachment still mutates only the base allAttachments cell, so deleting the auto entry is impossible and the chip reappears immediately.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

<ct-hstack align="center" gap="1">
<ct-attachments-bar
attachments={allAttachments}
attachments={attachmentsWithRecent}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-attached charms rendered by the bar can no longer be removed: the bar now reads from attachmentsWithRecent, but removeAttachment still mutates only the base allAttachments cell, so deleting the auto entry is impossible and the chip reappears immediately.

Prompt for AI agents
Address the following comment on packages/patterns/chatbot.tsx at line 459:

<comment>Auto-attached charms rendered by the bar can no longer be removed: the bar now reads from attachmentsWithRecent, but removeAttachment still mutates only the base allAttachments cell, so deleting the auto entry is impossible and the chip reappears immediately.</comment>

<file context>
@@ -389,7 +456,7 @@ export default recipe&lt;ChatInput, ChatOutput&gt;(
       &lt;ct-hstack align=&quot;center&quot; gap=&quot;1&quot;&gt;
         &lt;ct-attachments-bar
-          attachments={allAttachments}
+          attachments={attachmentsWithRecent}
           removable
           onct-remove={removeAttachment({ allAttachments })}
</file context>
Fix with Cubic

@bfollington bfollington merged commit 4efbb28 into main Oct 30, 2025
9 checks passed
@bfollington bfollington deleted the ben/ct-1013-allow-access-auto-attach-recentlyviewed-charms-in branch October 30, 2025 05:23
jkomoros pushed a commit that referenced this pull request Oct 30, 2025
* Auto-attach currently viewed charm

and introduce `listRecent` tool

* Make system prompt customizable for `chatbot.tsx`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants